Fix failing errata ui tests - #20840
Conversation
Reviewer's GuideThis PR updates errata UI tests to remove dependencies on the deprecated content hosts page and to make errata applicability checks more robust and deterministic, mainly by removing an obsolete assertion block, adding container-skipping markers, normalizing timestamp handling, and explicitly waiting for applicability tasks after yum installations. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new applicability wait logic (computing
install_timestamp, runningyum install, and then pollingmodule_target_sat.wait_for_tasks) is duplicated across multiple tests; consider extracting this into a small helper to keep the tests DRY and easier to maintain. - Now that
install_timestampis formatted viastrftime(TIMESTAMP_FMT)in some tests but not others, it might be worth standardizing the timestamp handling (possibly by a shared helper) to avoid subtle differences in howstarted_atfilters are constructed.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new applicability wait logic (computing `install_timestamp`, running `yum install`, and then polling `module_target_sat.wait_for_tasks`) is duplicated across multiple tests; consider extracting this into a small helper to keep the tests DRY and easier to maintain.
- Now that `install_timestamp` is formatted via `strftime(TIMESTAMP_FMT)` in some tests but not others, it might be worth standardizing the timestamp handling (possibly by a shared helper) to avoid subtle differences in how `started_at` filters are constructed.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
PRT Result |
|
| assert host_tab_erratum[0]['Errata'] == CUSTOM_REPO_ERRATA_ID | ||
|
|
||
|
|
||
| @pytest.mark.no_containers |
There was a problem hiding this comment.
Wonder if we can keep the container hosts (they are deployed much faster and should be sufficient for these cases) and get these tests passing.
Does the consequential wait_for_tasks fail, or what it the reason behind this change?
There was a problem hiding this comment.
I was unable to get wait_for_tasks to pass without that pytest mark. Do you know the reason for this?
There was a problem hiding this comment.
I think it could be related to the package profile upload again. Will need to check..
There was a problem hiding this comment.
@vsedmik what if we use container_host as it is and just update search query to include orgnization id in it?
ex-
search_query=(
f'Bulk generate applicability for host {hostname}'
f' and started_at >= "{install_timestamp}"'
f' and organzation_id = {module_sca_manifest_org.id}'
)
There was a problem hiding this comment.
IMHO not necessary @vijaysawant. PRT passed as is.
|
|
vijaysawant
left a comment
There was a problem hiding this comment.
@aidenfine can you check with the suggested changes?
use content_host and update search query to include host id.
| assert host_tab_erratum[0]['Errata'] == CUSTOM_REPO_ERRATA_ID | ||
|
|
||
|
|
||
| @pytest.mark.no_containers |
There was a problem hiding this comment.
@vsedmik what if we use container_host as it is and just update search query to include orgnization id in it?
ex-
search_query=(
f'Bulk generate applicability for host {hostname}'
f' and started_at >= "{install_timestamp}"'
f' and organzation_id = {module_sca_manifest_org.id}'
)
|
* fix failing errata tests * add subscription-manager repo command to fix failing test * remove no containers mark * remove no_containers from test_positive_errata_search_type (cherry picked from commit 6e909f9)
Problem Statement
Some Errata UI tests failing due to content hosts page removal
Solution
Remove/fix parts of test that use content hosts page
Related Issues
https://issues.redhat.com/browse/SAT-42273
PRT test Cases example
PRT usage reference link: https://github.com/SatelliteQE/robottelo/wiki/Robottelo-Pull-Request-Testing-(PRT)-Process#usage-examples
Summary by Sourcery
Adjust errata UI tests to avoid removed content hosts page and ensure errata applicability is reflected after package installation tasks complete.
Bug Fixes:
Enhancements: